<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>

<html:form action="perpustakaan.do?action=bukuSave">
    <table cellpadding="1" cellspacing="1" width="100%">
        <tr class="netral">
            <td colspan="2"><bean:message key="buku.buku"/></td>
        </tr>
        <tr class="form">
            <td width="15%"><bean:message key="buku.kode"/></td>
            <td>: <html:text property="buku" onkeyup="cekBuku(this.value)" size="50"/><span id="theMessage"/></td>
        </tr>
        <!--tr>
            <td><bean:message key="perpustakaan.tanggalPinjam"/></td>
            <td>:</td>
            <td><html:text property="tanggalPinjam" size="50"/></td>
        </tr-->
        <tr class="form">
            <td><bean:message key="perpustakaan.tanggalKembali"/></td>
            <td>:
            <html:text property="tanggalKembali" readonly="true"/>
                <a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fPopCalendar(document.PerpustakaanForm.tanggalKembali);return false;" HIDEFOCUS><img class="PopcalTrigger" align="absmiddle" src="page/calendar/calbtn.gif" width="34" height="22" border="0" alt=""></a>
            </td>
        </tr>
        <tr class="form">
            <td colspan="2" align="right"><input type="button" onclick="validate_Buku_form()" value="${buttonAdd}"/></td>
        </tr>
    </table>
</html:form>
<iframe width=174 height=189 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="page/calendar/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">
</iframe>
<table cellpadding="1" cellspacing="1" width="100%">
    <tr class="netral">
        <td colspan="6"><bean:message key="label.tabel"/> <bean:message key="buku.buku"/></td>
    </tr>
    <tr class="header">
        <td><bean:message key="label.no"/></td>
        <td><bean:message key="buku.kode"/></td>
        <td><bean:message key="buku.nama"/></td>
        <td><bean:message key="perpustakaan.tanggalPinjam"/></td>
        <td><bean:message key="perpustakaan.tanggalKembali"/></td>
        <td><bean:message key="label.delete"/></td>
    </tr>
    <logic:notEmpty name="listPeminjamanBuku">
        <c:forEach var="listPeminjamanBuku" items="${listPeminjamanBuku}" varStatus="row">
            <c:if test="${(row.count) % 2 == 0}"><tr class="over"></c:if>
            <c:if test="${(row.count) % 2 != 0}"><tr class="down"></c:if>
                <td width="5%"><c:out value="${row.count}"/></td>
                <td width="15%" align="left"><c:out value="${listPeminjamanBuku.buku.kodeBuku}"/></td>
                <td width="35%" align="left"><c:out value="${listPeminjamanBuku.buku.namaBuku}"/></td>
                <td width="15%" align="left"><f:formatDate value="${listPeminjamanBuku.tanggalPinjam}" pattern="dd-MMM-yyyy"/></td>
                <td width="15%" align="left"><f:formatDate value="${listPeminjamanBuku.tanggalKembali}" pattern="dd-MMM-yyyy"/></td>
                <td><html:link action="/perpustakaan.do?action=bukuAddDelete" paramName="listPeminjamanBuku" paramProperty="buku.kodeBuku" paramId="buku" styleClass="noLink"><bean:message key="label.yes"/></html:link></td>
            </tr>
        </c:forEach>
    </logic:notEmpty>
    <tr class="form">
        <td colspan="6">&nbsp;</td>
    </tr>
    <logic:empty name="listPeminjamanBuku">
        <tr class="form">
            <td colspan="6" align="center"><bean:message key="buku.buku"/> <bean:message key="label.isEmpty"/></td>
        </tr>
    </logic:empty>
    <tr class="form">
        <td colspan="6" align="right"><html:link href="perpustakaan.do?action=peminjamanBuku" styleClass="noLink"><input type="button" value="${buttonBack}"/></html:link></td>
    </tr>
</table>